package cn.class2.demo6

import scala.util.Random

/**
  * Created by lzd on 2018/11/14.
  * 同一类型数组单个值匹配
  */
object Demo1 {
  def main(args: Array[String]): Unit = {
    val arr = Array("hello", "scala", "spark")
    val value = arr(Random.nextInt(arr.length))
    println(value)

    value match {
      case "hello" => println("进入 hello")
      case "scala" => println("进入scala")
      case "sparkkkk" => println("进入 spark")
      case _ => println("没有找到结果")
    }
  }
}
